#pragma once
#include <map>
#include "CLocalObject.h"
#include "CChainItem.h"
#include "CLComLibrarys_global.h"
//CLCOMLIBRARYS_EXPORT

class CLCOMLIBRARYS_EXPORT CLComChain : public CLocalObject
{
private:
    CLComChain();
public:
    ~CLComChain();
    static CLComChain* GetChain();
public:
    bool AddItem(CLComString id, CLComString fid, int itemType);
	
    CLComString GetSonID(CLComString goalID, CLComString currentID);
    int GetIDType(CLComString goalID);
    CLComString GetFChainItemByType(CLComString goalID, int itemType);
    void UpgradeSonItem(CLComString id);
    void DowngradeSonItem(CLComString predID, CLComString id);
public:
    void DelItem(CLComString id);
	
private:
    CChainItem* FindSonChainItem(CLComString id, CChainItem* goalItem);
    CChainItem* FindChainItem(CLComString id);

private:
    map<CLComString, CChainItem*>	m_mapIDItems;
};

